import numpy as np
import pandas as pd
import holoviews as hv
import bokeh
hv.extension('bokeh')
import seaborn as sns
%load_ext autoreload
%autoreload 2
import erg
ergram = erg.ERG(r'../data/BYB_Recording_2020-12-23_13.47.39.wav')
For a specific frequency, this is where all of that frequency occurred for each color.
hv.Curve(
data=ergram.df,
kdims=['time (s)'],
vdims=['TTL', 'theoretical frequency','color'],
).groupby(
['color','theoretical frequency']
).overlay(
'color'
).layout(
'theoretical frequency'
)
Hey ET! You can zoom in on each data point using the HoloViews explorer. This is just a way to look at where each color occurs in the experiment for each frequency, tee-ing up a similar graph below.
%%opts Curve {+axiswise}
# per https://github.com/holoviz/holoviews/issues/2910, (alternatively, https://github.com/holoviz/holoviews/issues/2343),
hv.Curve(
data=ergram.df[ergram.df.color=='UV'],
kdims=['time (s)'],
vdims=['channel 1', ('theoretical frequency', 'frequency (Hz)')],
).groupby(
['theoretical frequency']
).layout(
'theoretical frequency'
)
So this is kind of interesting. Toward the end of the end of stimulation, especially with prolonged periods of stimulation (e.g., at high frequencies or low frequencies), you get some movement artifact. I saw the cockroaches really seem to not like that- they would squirm a lot. Another observation which I think is even more important, at around the halfway point, you see some short upward notch.
%%opts Curve {+axiswise}
# per https://github.com/holoviz/holoviews/issues/2910, (alternatively, https://github.com/holoviz/holoviews/issues/2343),
hv.Curve(
data=ergram.df[ergram.df.color=='B'],
kdims=['time (s)'],
vdims=['channel 1', ('theoretical frequency', 'frequency (Hz)')],
).groupby(
['theoretical frequency']
).layout(
'theoretical frequency'
)
%%opts Curve {+axiswise}
# per https://github.com/holoviz/holoviews/issues/2910, (alternatively, https://github.com/holoviz/holoviews/issues/2343),
hv.Curve(
data=ergram.df[ergram.df.color=='G'],
kdims=['time (s)'],
vdims=['channel 1', ('theoretical frequency', 'frequency (Hz)')],
).groupby(
['theoretical frequency']
).layout(
'theoretical frequency'
)
%%opts Curve {+axiswise}
# per https://github.com/holoviz/holoviews/issues/2910, (alternatively, https://github.com/holoviz/holoviews/issues/2343),
hv.Curve(
data=ergram.df[ergram.df.color=='R'],
kdims=['time (s)'],
vdims=['channel 1', ('theoretical frequency', 'frequency (Hz)')],
).groupby(
['theoretical frequency']
).layout(
'theoretical frequency'
)
%%opts Curve {+axiswise}
# per https://github.com/holoviz/holoviews/issues/2910, (alternatively, https://github.com/holoviz/holoviews/issues/2343),
hv.Curve(
data=ergram.df[ergram.df.color=='IR'],
kdims=['time (s)'],
vdims=['channel 1', ('theoretical frequency', 'frequency (Hz)')],
).groupby(
['theoretical frequency']
).layout(
'theoretical frequency'
)